package com.atguigu.flink.chapter05.function;

import com.atguigu.flink.bean.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

public class WaterSensorMapFunction implements MapFunction<String, WaterSensor> {

    @Override
    public WaterSensor map(String value) throws Exception {
        String[] data = value.split(",");
        return new WaterSensor(data[0],Long.valueOf(data[1]),Integer.valueOf(data[2]) );
    }
}
